//
//  ShowFilterBtn.m
//  FengWoFilterTickerDemo
//
//  Created by yang on 15/10/29.
//  Copyright © 2015年 FengWo. All rights reserved.
//

#import "ShowFilterBtn.h"

@implementation ShowFilterBtn

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

-(id)initWithCoder:(NSCoder *)aDecoder
{
    if (self = [super initWithCoder:aDecoder]) {
        [self createAttribute];
    }
    return self;
}

-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self createAttribute];
    }
    return self;
}


- (void)createAttribute
{
    self.titleLabel.font = [UIFont boldSystemFontOfSize:12];
    [self setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
}


- (CGRect)imageRectForContentRect:(CGRect)contentRect
{
    return CGRectMake(0, 0, self.frame.size.width,self.frame.size.width);
}

-(CGRect)titleRectForContentRect:(CGRect)contentRect
{
    return CGRectMake(0,self.frame.size.width, self.frame.size.width,self.frame.size.height - self.frame.size.width);
}


@end
